

function RefreshRevenueFields(asFields, afFieldValues, iOTC)
{
var bRefreshGrid = false;


for (var i=0;i<asFields.length;i++)
{
if(!IsNull(crmForm.all[asFields[i]]) && !IsNull(afFieldValues[i]) && !isNaN(afFieldValues[i]))
{
crmForm.all[asFields[i]].DataValue = afFieldValues[i];
bRefreshGrid = true;
}
}


if (bRefreshGrid)
{
try
{
window.opener.auto(iOTC);
}
catch(e){}
}
}


function AddTransactionCurrencyParam(oLookup)
{
var oTransCurId = crmForm.transactioncurrencyid;
var sTransCurId = "";

if (!IsNull(oTransCurId.DataValue))
{
sTransCurId = oTransCurId.DataValue[0].id;
}

oLookup.AddParam("transactioncurrencyid", sTransCurId);
}
